From: George Dunlap Date: Fri, 23 Nov 2012 11:06:14 +0000 (+0000) Subject: xl: Suppress spurious warning message for cpupool-list X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~7619 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=18cd92eed4d68421ecaf55469b1d00b641582d0d;p=xen.git xl: Suppress spurious warning message for cpupool-list libxl_cpupool_list() enumerates the cpupools by "probing": calling cpupool_info, starting at 0 and stopping when it gets an error. However, cpupool_info will print an error when the call to xc_cpupool_getinfo() fails, resulting in every xl command that uses libxl_list_cpupool (such as cpupool-list) printing that error message spuriously. Since at the moment the times we want to print the message correspond with the use of the existing "exact" parameter, use it to decide whether to print the message or not. Signed-off-by: George Dunlap Acked-by: Ian Campbell Committed-by: Ian Campbell --- diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index acb240a1a3..de75ee0f25 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -593,7 +593,8 @@ static int cpupool_info(libxl__gc *gc, xcinfo = xc_cpupool_getinfo(CTX->xch, poolid); if (xcinfo == NULL) { - LOGE(ERROR, "failed to get info for cpupool%d\n", poolid); + if (exact || errno != ENOENT) + LOGE(ERROR, "failed to get info for cpupool%d\n", poolid); return ERROR_FAIL; }